package com.yhxd.modular.reference.api;

import com.yhxd.modular.reference.entity.Duties;
import com.yhxd.modular.reference.service.DutiesService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping(value = "/api/duties")
@Api
public class ApiDutiesController {

    @Autowired
    private DutiesService dutiesService;

    /**
     * 跳转到展示页
     * @return
     */
    @GetMapping(value = "/info")
    public String dutiesInfo(Model model) {
        Duties duties = this.dutiesService.findById(1L);
        model.addAttribute("duties", duties);
        return "web/pages/duties_info";
    }
}
